Skip to content

Revert "feat(disability_registry): stabilization improvements for spp_disability_registry (#1047)" (#263)#268

Merged
emjay0921 merged 1 commit into
19.0from
revert-263-disability-registry
Jul 2, 2026
Merged

Revert "feat(disability_registry): stabilization improvements for spp_disability_registry (#1047)" (#263)#268
emjay0921 merged 1 commit into
19.0from
revert-263-disability-registry

Conversation

@emjay0921

Copy link
Copy Markdown
Contributor

Why is this change needed?

Reverts the merge of PR #263 (merge commit f260ffd3) from 19.0. The Disability Registry stabilization work needs to be pulled back out of 19.0 for now and re-reviewed before it lands.

How was the change implemented?

git revert -m 1 f260ffd3 — reverts the merge against mainline (parent 1), removing all spp_disability_registry / spp_starter_disability_registry changes introduced by #263. No history rewrite.

Note

To re-introduce this work later it must be reapplied (revert-of-this-revert or a rebased branch) — a fresh PR from the original branch tip alone will show an empty diff because those commits remain ancestors of 19.0. A draft PR reapplying the work will be opened separately.

Related links

Reverts #263 · OP#1047

…istry-improvements"

This reverts commit f260ffd, reversing
changes made to 02de7ba.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request simplifies the spp_disability_registry module by removing the child functioning module (CFM) questionnaire fields, the configuration settings, and the separate impairment and device request models, refactoring them into direct fields on the assessment model. It also removes the spp_starter_disability_registry starter bundle. Feedback on these changes highlights two critical issues: first, using @api.onchange to set is_proxy_response fails to trigger during programmatic creation, so a stored computed field should be used instead; second, removing the readonly attribute from the assessment form view allows approved or pending records to be edited, and the dynamic read-only state should be restored.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +276 to +280
@api.onchange("assessment_type")
def _onchange_assessment_type(self):
"""Set proxy response flag automatically for child assessments."""
if self.assessment_type in ("cfm_2_4", "cfm_5_17"):
self.is_proxy_response = True

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using @api.onchange to set is_proxy_response means this logic will only execute in the web client interface. When assessments are created programmatically (e.g., via create(), API, or demo data), the onchange is not triggered, leaving is_proxy_response as False for child assessments. This is also evident in the test test_proxy_flag_set_for_child where _onchange_assessment_type() has to be called manually.

To ensure this business rule is always enforced, is_proxy_response should be a computed field (with store=True and readonly=False if manual overrides are allowed).

string="Disability Assessment"
readonly="approval_state not in ('draft', 'revision')"
>
<form string="Disability Assessment">

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Removing the readonly attribute from the <form> tag makes the entire assessment form editable even after the assessment has been approved or is pending validation. Approved disability records should be read-only to prevent unauthorized modifications.

Please restore the dynamic read-only state on the form view using the conventional Odoo 17+ pattern:

<form string="Disability Assessment" readonly="approval_state not in ('draft', 'revision')">
References
  1. In Odoo 17+, use to dynamically set the read-only state for all fields in a form view, as this is the supported and conventional pattern.

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 75.30%. Comparing base (f260ffd) to head (82c4eca).

Files with missing lines Patch % Lines
spp_disability_registry/models/assessment.py 93.33% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             19.0     #268      +/-   ##
==========================================
- Coverage   75.31%   75.30%   -0.02%     
==========================================
  Files        1098     1096       -2     
  Lines       65317    64992     -325     
==========================================
- Hits        49191    48939     -252     
+ Misses      16126    16053      -73     
Flag Coverage Δ
spp_base_common 90.26% <ø> (ø)
spp_disability_registry 91.86% <93.75%> (+7.98%) ⬆️
spp_programs 65.27% <ø> (ø)
spp_registry 86.83% <ø> (ø)
spp_security 66.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
spp_disability_registry/__manifest__.py 0.00% <ø> (ø)
spp_disability_registry/models/__init__.py 100.00% <ø> (ø)
spp_disability_registry/models/assistive_device.py 100.00% <ø> (ø)
spp_disability_registry/models/registrant.py 100.00% <100.00%> (+1.66%) ⬆️
spp_disability_registry/models/assessment.py 94.68% <93.33%> (+16.93%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@emjay0921 emjay0921 merged commit 622c51d into 19.0 Jul 2, 2026
20 checks passed
@emjay0921 emjay0921 deleted the revert-263-disability-registry branch July 2, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant